package com.ruoyi.loginrisk.utils;

import java.awt.*;
import java.net.InetAddress;

public class DeviceInfoUtils {

    /*// 获取操作系统信息
    public static String getOSInfo() {
        return System.getProperty("os.name") + " " +
                System.getProperty("os.version") + " (" +
                System.getProperty("os.arch") + ")";
    }

    // 获取屏幕分辨率（仅桌面环境有效）
    public static String getScreenResolution() {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        return screenSize.width + "x" + screenSize.height;
    }*/

    // 获取设备主机名
    public static String getHostName() {
        try {
            return InetAddress.getLocalHost().getHostName();
        } catch (Exception e) {
            return "Unknown";
        }
    }

    // 获取Java运行时信息
    public static String getJavaRuntimeInfo() {
        return System.getProperty("java.vendor") + " " +
                System.getProperty("java.version");
    }
}
